package pl.edu.mimuw.irs.rcp.view.figure;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.handles.HandleBounds;

/**
 * @author Jakub Rauch
 * Created on: 2009-05-26
 */
public class EllipseHandleBoundsAnchor extends EllipseAnchor {

	// *** Attributes
	
    private final HandleBounds handleBounds;
    
    // *** Constructors
    
    public EllipseHandleBoundsAnchor(IFigure figure) {
        super(figure);

        if (!(figure instanceof HandleBounds)) {
            // TODO error
        	handleBounds = null;
        } else {
	        handleBounds = (HandleBounds) figure;
        }
    }
    
	// *** Methods
    
    protected Rectangle getBox() {
        if (handleBounds != null) return handleBounds.getHandleBounds();
    	else return new Rectangle();
    }
}
